﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="WebApplication1.TestThread.Test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function clear1() {
            var inputArray = document.getElementsByTagName("input");
            alert(inputArray);
            for (var i = 0; i < inputArray.length; i++) 
            {
                if (inputArray[i].type == "text") {
                    inputArray[i].value = "";
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:TextBox ID="TextBox1" runat="server">dfg</asp:TextBox>
    <asp:TextBox ID="TextBox2" runat="server">sdfa</asp:TextBox> 
    &nbsp;<asp:Button ID="Button1" runat="server" Height="20px" Text="后台赋空值" 
            onclick="Button1_Click" />
            <input  type="button" id="btn" value="js赋空值" onclick="clear1()"/>
    </div>
    </form>
</body>
</html>
